Skip to content

feat(caprock): add ocap proxy plugin#953

Draft
grypez wants to merge 14 commits into
grypez/bringing-in-the-sheavesfrom
grypez/caprock
Draft

feat(caprock): add ocap proxy plugin#953
grypez wants to merge 14 commits into
grypez/bringing-in-the-sheavesfrom
grypez/caprock

Conversation

@grypez
Copy link
Copy Markdown
Contributor

@grypez grypez commented May 26, 2026

WIP

grypez and others added 7 commits May 20, 2026 11:56
…ives

Adds two new capabilities needed by the modal authorization flow:

NodeSocketDuplexStream (@metamask/streams):
  A duplex stream over a Node net.Socket. Reads NDJSON lines inbound,
  writes NDJSON lines outbound. Reader/writer cross-terminate on end.
  Exported via the streams package barrel.

Session channel (kernel-utils/session):
  makeChannel() — a broadcast channel that fans SectionNotification
  messages to all connected ModalStream subscribers and resolves a
  Decision promise back to the broadcaster. New subscribers receive a
  replay of all currently-pending (undecided) notifications.
  SectionRequest / SectionNotification / Decision wire types.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…onApi types

Transport-agnostic user-facing types used by both the TUI and the browser
extension Authorization panel. Placing them in kernel-utils/session makes
them available to any package without a node-runtime dependency.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ket server

Adds ChannelFactory exo (kernel service), SessionRegistry, StreamSocketServer,
and DaemonClient to support CLI-driven authorization session management.
The daemon now exposes session RPC methods and a persistent stream socket for
TUI subscriber connections.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- channel: track queuedAt timestamp, record history log with listAll()
- session-registry: add startedAt/cwd, add listHistory() and authorizeRequest()
- rpc-socket-server: add session.history and session.authorize RPC methods;
  include cwd/startedAt in session.create/list/get responses

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds ocap session create/list/requests/queue/approve/reject subcommands.
Refactors daemon-client to delegate socket/RPC helpers to kernel-node-runtime,
and extracts session command builder into session.ts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@grypez grypez changed the base branch from main to grypez/bringing-in-the-sheaves May 26, 2026 16:34
@socket-security
Copy link
Copy Markdown

socket-security Bot commented May 26, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedink-spinner@​5.0.01001007682100
Addedink-select-input@​6.2.010010010082100
Addedink-text-input@​6.0.010010010082100
Addedtree-sitter-bash@​0.25.11001008687100
Addedink@​5.2.19810010096100

View full report

@socket-security
Copy link
Copy Markdown

socket-security Bot commented May 26, 2026

Caution

MetaMask internal reviewing guidelines:

  • Do not ignore-all
  • Each alert has instructions on how to review if you don't know what it means. If lost, ask your Security Liaison or the supply-chain group
  • Copy-paste ignore lines for specific packages or a group of one kind with a note on what research you did to deem it safe.
    @SocketSecurity ignore npm/PACKAGE@VERSION
Action Severity Alert  (click "▶" to expand/collapse)
Block Medium
Network access: npm react-reconciler in module globalThis["fetch"]

Module: globalThis["fetch"]

Location: Package overview

From: ?npm/ink@5.2.1npm/react-reconciler@0.29.2

ℹ Read more on: This package | This alert | What is network access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/react-reconciler@0.29.2. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Block Medium
Native binaries present: npm tree-sitter-bash

Location: Package overview

From: packages/caprock/package.jsonnpm/tree-sitter-bash@0.25.1

ℹ Read more on: This package | This alert | Why is native code a concern?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Verify that the inclusion of native code is expected and necessary for this package's functionality. If it is unnecessary or unexpected, consider using alternative packages without native code to mitigate potential risks.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/tree-sitter-bash@0.25.1. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Block Medium
Network access: npm yoga-layout in module globalThis["fetch"]

Module: globalThis["fetch"]

Location: Package overview

From: ?npm/ink@5.2.1npm/yoga-layout@3.2.1

ℹ Read more on: This package | This alert | What is network access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/yoga-layout@3.2.1. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Low
Potential code anomaly (AI signal): npm node-addon-api is 100.0% likely to have a medium risk anomaly

Notes: The script is a legitimate formatting helper within a Node.js project. It orchestrates clang-format via git-clang-format, supports fix and diff modes, and provides actionable feedback to the developer. While operational dependencies exist, no malicious activity or data leakage is evident based on the provided code and typical usage.

Confidence: 1.00

Severity: 0.60

From: ?npm/tree-sitter@0.25.0npm/tree-sitter-javascript@0.25.0npm/tree-sitter-bash@0.25.1npm/node-addon-api@8.7.0

ℹ Read more on: This package | This alert | What is an AI-detected potential code anomaly?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: An AI system found a low-risk anomaly in this package. It may still be fine to use, but you should check that it is safe before proceeding.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/node-addon-api@8.7.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Low
Potential code anomaly (AI signal): npm ws is 100.0% likely to have a medium risk anomaly

Notes: The code implements a standard EventTarget-like mixin for wrapping event listeners and dispatching events to user callbacks. There are no suspicious patterns such as dynamic code execution, hardcoded secrets, or network activity. The risk is contingent on what the consumer does inside their handlers; the snippet itself does not introduce malware or data leakage mechanisms beyond normal event dispatch. Overall security risk is low in isolation.

Confidence: 1.00

Severity: 0.60

From: ?npm/@libp2p/websockets@10.1.7npm/@vitest/browser@4.1.3npm/ink@5.2.1npm/ws@8.20.1

ℹ Read more on: This package | This alert | What is an AI-detected potential code anomaly?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: An AI system found a low-risk anomaly in this package. It may still be fine to use, but you should check that it is safe before proceeding.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/ws@8.20.1. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Low
Potential code anomaly (AI signal): npm ws is 100.0% likely to have a medium risk anomaly

Notes: The analyzed code segment represents a robust, standards-aligned WebSocket receiver. It correctly handles frame parsing, masking, fragmentation, and optional compression via PerMessageDeflate, with appropriate validation and error signaling. There is no evidence of malicious intent or backdoors within this module; the security posture is solid for a protocol parser, with typical risks mitigated by payload size checks and UTF-8 validation. Overall, the code is appropriate for integration in a WebSocket client/server library, with moderate security risk primarily tied to how downstream consumers handle emitted data and potential resource usage under edge cases.

Confidence: 1.00

Severity: 0.60

From: ?npm/@libp2p/websockets@10.1.7npm/@vitest/browser@4.1.3npm/ink@5.2.1npm/ws@8.20.1

ℹ Read more on: This package | This alert | What is an AI-detected potential code anomaly?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: An AI system found a low-risk anomaly in this package. It may still be fine to use, but you should check that it is safe before proceeding.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/ws@8.20.1. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

grypez and others added 7 commits May 26, 2026 11:47
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… timeline entries

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…erators

Split bash commands joined by &&/||/; into independent clauses, each
routed separately through the permission sheaf. A compound command is
auto-accepted only when every clause has a covering provision. The TUI
provision editor shows one pattern-tuning block per clause and creates
one Provision per clause on submit.

Migrates provision?:Provision → provisions?:Provision[] throughout the
session layer (Decision, SessionHistoryEntry, Channel.record, etc.).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ropertyTypes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…decomposition

Pipeline stages wrapped in a redirected_statement (e.g. `cmd 2>&1 | tail -30`)
were silently dropped, causing only the tail end of the pipeline to appear as
an invocation. A provision on `tail *` would then incorrectly auto-accept the
entire command. Now all stages are collected regardless of redirect wrappers.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant